package com.cart.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class OrderHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    private int userId;                // 用户ID，表示该订单属于哪个用户
    private List<CartItem> items;      // 订单中包含的商品项列表
    private Date purchaseDate;         // 购买日期

    // 构造函数
    public OrderHistory(int userId, List<CartItem> items, Date purchaseDate) {
        this.userId = userId;
        this.items = items;
        this.purchaseDate = purchaseDate;
    }

    // Getters 和 Setters
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public List<CartItem> getItems() {
        return items;
    }

    public void setItems(List<CartItem> items) {
        this.items = items;
    }

    public Date getPurchaseDate() {
        return purchaseDate;
    }

    public void setPurchaseDate(Date purchaseDate) {
        this.purchaseDate = purchaseDate;
    }
}
